package cn.lg.soar.core.dto;

import cn.lg.soar.common.data.dict.IDict;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2023/12/6 12:46
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public class SysDict<V> {

    private String code;

    private String name;

    private IDict<V>[] dicts;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public IDict<V>[] getDicts() {
        return dicts;
    }

    public void setDicts(IDict<V>[] dicts) {
        this.dicts = dicts;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SysDict<?> sysDict = (SysDict<?>) o;
        return Objects.equals(code, sysDict.code) && Objects.equals(name, sysDict.name) && Arrays.equals(dicts, sysDict.dicts);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(code, name);
        result = 31 * result + Arrays.hashCode(dicts);
        return result;
    }
}
